package anni.aerp2.domain;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import anni.core.grid.LongGridBean;

import org.hibernate.annotations.GenericGenerator;


/**
 * Erp2BuyOrder generated by Lingo.
 *
 * @author Lingo
 * @since 2007年11月11日 上午 08时19分21秒93
 */
@Entity
@Table(name = "A_ERP2_BUY_ORDER")
public class Erp2BuyOrder extends LongGridBean {
    /** * serial. */
    static final long serialVersionUID = 0L;

    /** * id. */
    private Long id;

    /** * erp2Supplier. */
    private Erp2Supplier erp2Supplier;

    /** * orderDate. */
    private Date orderDate;

    /** * linkman. */
    private String linkman;

    /** * code. */
    private String code;

    /** * username. */
    private String username;

    /** * price. */
    private Double price;

    /** * status. */
    private Integer status;

    /** * provideDate. */
    private Date provideDate;

    /** * audit. */
    private Integer audit;

    /** * totalPrice. */
    private Double totalPrice;

    /** * name. */
    private String name;

    /** * erp2BuyOrderInfos. */
    private Set<Erp2BuyOrderInfo> erp2BuyOrderInfos = new HashSet<Erp2BuyOrderInfo>(0);

    /** * 构造方法. */
    public Erp2BuyOrder() {
    }

    /** * @return id. */
    @GenericGenerator(name = "generator", strategy = "increment")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "ID", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    /** * @param id Long. */
    public void setId(Long id) {
        this.id = id;
    }

    /** * @return erp2Supplier. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SUPPLIER_ID")
    public Erp2Supplier getErp2Supplier() {
        return erp2Supplier;
    }

    /** * @param erp2Supplier Erp2Supplier. */
    public void setErp2Supplier(Erp2Supplier erp2Supplier) {
        this.erp2Supplier = erp2Supplier;
    }

    /** * @return orderDate. */
    @Column(name = "ORDER_DATE")
    public Date getOrderDate() {
        return orderDate;
    }

    /** * @param orderDate Date. */
    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    /** * @return linkman. */
    @Column(name = "LINKMAN", length = 50)
    public String getLinkman() {
        return linkman;
    }

    /** * @param linkman String. */
    public void setLinkman(String linkman) {
        this.linkman = linkman;
    }

    /** * @return code. */
    @Column(name = "CODE", length = 50)
    public String getCode() {
        return code;
    }

    /** * @param code String. */
    public void setCode(String code) {
        this.code = code;
    }

    /** * @return username. */
    @Column(name = "USERNAME", length = 50)
    public String getUsername() {
        return username;
    }

    /** * @param username String. */
    public void setUsername(String username) {
        this.username = username;
    }

    /** * @return price. */
    @Column(name = "PRICE")
    public Double getPrice() {
        return price;
    }

    /** * @param price Double. */
    public void setPrice(Double price) {
        this.price = price;
    }

    /** * @return status. */
    @Column(name = "STATUS")
    public Integer getStatus() {
        return status;
    }

    /** * @param status Integer. */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /** * @return provideDate. */
    @Column(name = "PROVIDE_DATE")
    public Date getProvideDate() {
        return provideDate;
    }

    /** * @param provideDate Date. */
    public void setProvideDate(Date provideDate) {
        this.provideDate = provideDate;
    }

    /** * @return audit. */
    @Column(name = "AUDIT")
    public Integer getAudit() {
        return audit;
    }

    /** * @param audit Integer. */
    public void setAudit(Integer audit) {
        this.audit = audit;
    }

    /** * @return totalPrice. */
    @Column(name = "TOTAL_PRICE")
    public Double getTotalPrice() {
        return totalPrice;
    }

    /** * @param totalPrice Double. */
    public void setTotalPrice(Double totalPrice) {
        this.totalPrice = totalPrice;
    }

    /** * @return name. */
    @Column(name = "NAME", length = 50)
    public String getName() {
        return name;
    }

    /** * @param name String. */
    public void setName(String name) {
        this.name = name;
    }

    /** * @return erp2BuyOrderInfos. */
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "erp2BuyOrder")
    public Set<Erp2BuyOrderInfo> getErp2BuyOrderInfos() {
        return erp2BuyOrderInfos;
    }

    /** * @param erp2BuyOrderInfos Set. */
    public void setErp2BuyOrderInfos(
        Set<Erp2BuyOrderInfo> erp2BuyOrderInfos) {
        this.erp2BuyOrderInfos = erp2BuyOrderInfos;
    }
}
